{% extends "tcms_base.html" %}
{% load static %}
{% block subtitle %}Create new test plan{% endblock %}

{% block extra_head %}
{{ form.media }}
{% endblock %}

{% block custom_stylesheet %}
{% endblock %}

{% block custom_javascript %}
<script type="text/javascript" src="{% static 'js/testplan_actions.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/admin/RelatedObjectLookups.js' %}"></script>
<script type="text/javascript">
Nitrate.Utils.after_page_load(Nitrate.TestPlans.Create.on_load);
</script>
{% endblock %}

{% block contents %}

<div id="content">
	<form method="post" action="{% url "plans-new" %}" enctype="multipart/form-data">
		<h2>Create New Test Plan</h2>
		<div class="Detailform border-1" >
			<table class="editor" cellspan="0" cellspacing="0">
				<tr>
					<td width="20%" valign="top"><label class="lab strong" for="id_title">Plan Name</label><span >{{ form.attrib.errors }}</span></td>
					<td width="80%">
						<span class="name summary">{{ form.name }}</span>
						<div >{{ form.name.errors }}</div>
					</td>
				</tr>
				<tr>
					<td width="20%" valign="top"><label class="lab strong" for="id_product_id">Product</label></td>
					<td>
						<span class="name" >{{ form.product }}</span>
						<span >{{ form.product.errors }}</span>
              <a id="add_id_product" href="{% url 'admin:management_product_add' %}" class="addlink" >
							Add Product
						</a>
						<span class="grey">After Add and Refresh page</span>
					</td>
				</tr>
				<tr>
					<td width="20%" valign="top"><label class="lab strong" for="id_version_id">Product Version</label></td>
					<td>
						<span>{{ form.product_version }}</span>
						<span >{{ form.product_version.errors }}</span>
                        <a id="add_id_product_version" href="{% url 'admin:management_version_add' %}" class="addlink" >
							Add Product Version
						</a>
						<span class="grey">After Add and Refresh page</span>
					</td>
				</tr>
				<tr>
					<td valign="top"><label class="lab strong" for="id_type_id">Type</label></td>
					<td >
						<span class="name"> {{ form.type }} </span>
						<div > {{ form.type.errors }} </div>
					</td>
				</tr>
				<tr>
					<td valign="top"><label class="lab" for="id_parent">Parent ID</label></td>
					<td >
						<span class="name">{{ form.parent }}</span>
						<div>{{ form.parent.errors }}</div>
					</td>
				</tr>
				<tr>
					<td valign="top"><label class="lab" for="id_summary">Plan Document: </label></td>
					<td>
						<div class="mec">{{ form.text }}</div>
						<div>{{ form.text.errors }}</div>
					</td>
				</tr>
				<tr>
					<td valign="top"><label class="lab" for="id_extra_link">Reference Link:</label></td>
					<td>
						<div class="name summary">{{ form.extra_link }}</div>
						<div >{{ form.extra_link.errors }}</div>
					</td>
				</tr>
			</table>
			<div class="submit-row" >
				<input type="submit" value="Create test plan" />
				<input type="button" value="Cancel" class="js-cancel-button" />
			</div>
		</div>
	</form>
</div>
{% endblock %}
